Welcome Guest, you are in: Login

devio dbscript ScrewTurn Wiki

RSS RSS

Navigation





Search the wiki
»

PoweredBy

public getmanagedservicecountfornode (function)

RSS
Modified on 2011/08/27 11:44 by wikibot Categorized as Uncategorized

wikibot

Functionpublic.getmanagedservicecountfornode

Source

CREATE OR REPLACE FUNCTION public.getmanagedservicecountfornode(integer)
 RETURNS double precision
 LANGUAGE plpgsql
AS $function$
   DECLARE
        nid ALIAS FOR $1;
        orec RECORD;
        counter float8;
   BEGIN
        counter = 0;
         FOR orec IN SELECT distinct ifservices.nodeid, ifservices.serviceid, ifservices.ipaddr
                FROM ipinterface, ifservices
                WHERE ifservices.nodeid = nid
                        AND ipinterface.nodeid = nid
                        AND ipinterface.ismanaged = 'M'
                        AND ifservices.ipaddr = ipinterface.ipaddr
                        AND ifservices.status = 'A'
        LOOP
                BEGIN
                         counter := counter + 1;
                END;
        END LOOP;
        RETURN counter;
   END;
$function$

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam.